<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
		<title>订单</title>
		<link rel="stylesheet" type="text/css" href="../static/azxcrm/css/wap/aui.css" th:href="@{/azxcrm/css/wap/aui.css}"/>
		<link rel="stylesheet" type="text/css" href="../static/azxcrm/css/wap/order_audited_refund.css" th:href="@{/azxcrm/css/wap/order_audited_refund.css}"/>
		<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_835360_8flqp9ignrc.css"/>
		<script type="text/javascript" src="../static/azxcrm/js/wap/api.js" th:src="@{/azxcrm/js/wap/api.js}"></script>
		<script type="text/javascript" src="../static/azxcrm/js/wap/aui-tab.js" th:src="@{/azxcrm/js/wap/aui-tab.js}"></script>
	 <script src="../static/azxcrm/js/wap/jquery-3.3.1.min.js" type="text/javascript" th:src="@{/azxcrm/js/wap/jquery-3.3.1.min.js}"
    charset="utf-8"></script>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav">
			 <a th:href="@{/wap/wapMy}"  class="aui-pull-left aui-btn">
	       		 <span class="iconfont icon-fanhui1">返回</span>
	    	</a>
		    <div class="aui-title">订单</div>
		</header>
		
		<div class="aui-tab aui-border-b" id="tab">
            <div class="aui-tab-item aui-active" data-item-order="0">跟进中</div>
            <div class="aui-tab-item" data-item-order="1">待审核</div>
            <div class="aui-tab-item" data-item-order="2">已结单</div>
            <div class="aui-tab-item" data-item-order="3">已退单</div>
        </div>
        <div class="aui-padded-5 " id="tab1-con">
        <!--跟进中-->
        <div id="tab1-con1" class="ishide">
			<section class="aui-grid aui-margin-b-15">
				<div class="aui-content aui-margin-b-15" th:each="orderDispatch:${orderDispatchList}" th:if="${orderDispatch.order.orderStatus}==1 or ${orderDispatch.order.orderStatus}==2">
				  <div class="order-bottom" th:if="${orderDispatch.orderModifyRecord.modifyType != 1}"> 
				    <a class="aui-list" th:href="@{/wap/wapOrderDetail(orderId=${orderDispatch.order.orderId},status=1)}">
					    <ul class="aui-list aui-list-in g-gj">			       
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            		<div class="aui-list-item-title">订单号：<span th:text="${orderDispatch.order.orderNum}"></span></div>	
					                	<div class="aui-text pos-rel state">订单类型：<span th:text="${orderDispatch.order.typeName}"></span></div>	                
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
						                <div class="aui-list-item-title s-name">
						                	<img src="../static/azxcrm/image/wap/head-img.jpg" th:src="@{/azxcrm/image/wap/head-img.jpg}" class="aui-img-round"/>
						                	<span th:text="${orderDispatch.customerClue.customerName}"> </span>
						                	<span th:text="${orderDispatch.customerClue.customerCellphone}"> </span>
						                </div>
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
									<div class="u-time">
										<img src="../static/azxcrm/image/wap/time.png" th:src="@{/azxcrm/image/wap/time.png}" >
											<span>剩余保有时间：<strong th:text="${orderDispatch.dateNum}"></strong>天</span>
										<div class="aui-label aui-label-danger aui-label-outlined u-details">查看详情</div>
									
									</div>
					            </div>
					        </li>
					    </ul>
					    </a>
				  	 </div> 
					<div class="order-bottom" th:if="${orderDispatch.orderModifyRecord.modifyType == 1}">
						<a th:href="@{/wap/wapOrderReason(orderId=${orderDispatch.order.orderId},status=1)}">
					    <ul class="aui-list aui-list-in g-gj">			       
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            		<div class="aui-list-item-title">订单号：<span th:text="${orderDispatch.order.orderNum}"></span></div>	
					                	<div class="aui-text pos-rel state">订单类型：<span th:text="${orderDispatch.order.typeName}"></span></div>	                
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
						                <div class="aui-list-item-title s-name">
						                	<img src="../static/azxcrm/image/wap/head-img.jpg" th:src="@{/azxcrm/image/wap/head-img.jpg}" class="aui-img-round"/>
						                	<span th:text="${orderDispatch.customerClue.customerName}"> </span>
						                	<span th:text="${orderDispatch.customerClue.customerCellphone}"> </span>
						                	<!-- <div class="aui-label aui-label-danger aui-label-outlined u-details">查看详情</div> -->
						                </div>
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
									<div class="u-time">
										<img src="../static/azxcrm/image/wap/time.png" th:src="@{/azxcrm/image/wap/time.png}" >
										30天保护期已到，请填写未成单原因
										<div class="aui-label aui-label-danger aui-label-outlined u-details">查看详情</div>
									</div>
					            </div>
					        </li>
					    </ul>
					    </a>
					</div>
				</div>
			</section>
		</div>
		
        <!--待审核-->
        <div class="aui-hide ishide" id="tab1-con2">
			<section class="aui-grid aui-margin-b-15 ">
					<div class="aui-content aui-margin-b-15 dsh" th:each="auditOrder : ${auditOrderList}" th:if="${auditOrder.orderStatus ==3 or auditOrder.auditStatus==4} and ${auditOrder.refundReason ==null}">
					    <a th:href="@{/wap/order/waitAuditOrder(orderId=${auditOrder.orderId})}">
					    <ul class="aui-list aui-list-in">			       
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            		<div class="aui-list-item-title">订单号：<span th:text="${auditOrder.orderNum}"></span></div>	
					                	<div class="aui-text pos-rel state">订单类型：<span th:text="${auditOrder.typeName}"></span></div>		                
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
						                <div class="aui-list-item-title s-name"><img src="../static/azxcrm/image/wap/head-img.jpg" th:src="@{/azxcrm/image/wap/head-img.jpg}" class="aui-img-round"/>
						                	<span th:text="${auditOrder.customerClue.customerName}"></span>
					                		<span th:text="${auditOrder.customerClue.customerCellphone}"></span>
						                  
						                </div>
						                <div class="aui-label aui-label-danger aui-label-outlined">查看详情</div>
					            </div>
					        </li>	
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            	<div class="clearfix g-background">
						                <div class="aui-list-item-title g-goods">关联商品：<span th:text="${auditOrder.fullName}"></span></div>
						                <div class="aui-text g-jd">
						                	状态：<span th:if="${auditOrder.auditStatus} == 0">未审核</span>
	                                		    <span th:if="${auditOrder.auditStatus} == 1">审核中</span>
	                                		    <span th:if="${auditOrder.auditStatus} == 2">审核通过</span>
	                                		    <span th:if="${auditOrder.auditStatus} == 3">审核被拒</span>
						                </div>
						            </div>    
					            </div>
					        </li>
					    </ul>
					    </a>
					</div>
			</section>
        </div>
        
        <!--已结单-->
        <div class="aui-hide ishide" id="tab1-con3">
			<section class="aui-grid aui-margin-b-15">
					<div class="aui-content aui-margin-b-15 dsh" th:each="orderDeal : ${orderDealList}" th:if="${orderDeal.order.orderStatus==5 or orderDeal.order.orderStatus==3 and orderDeal.order.refundReason!=null}">
					    <a th:href="@{/wap/order/finishOrder(orderId=${orderDeal.orderId})}">
					    <ul class="aui-list aui-list-in">			       
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            		<div class="aui-list-item-title">订单号：<span th:text="${orderDeal.order.orderNum}"></span></div>	
					                	<div class="aui-text pos-rel state">订单类型：<span th:text="${orderDeal.order.typeName}"></span></div>	                
					            </div>
					        </li>
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					                <div class="aui-list-item-title s-name" >
					                	<img src="../static/azxcrm/image/wap/head-img.jpg" th:src="@{/azxcrm/image/wap/head-img.jpg}" class="aui-img-round"/>
					                	<span th:text="${orderDeal.customerInfo.name}"></span>
					                	<span th:text="${orderDeal.customerInfo.cellphone}"></span>
					                </div>
					               	<div class="aui-label aui-label-danger aui-label-outlined">查看详情</div>
					            </div>
					        </li>	
					        <li class="aui-list-item">
					            <div class="aui-list-item-inner">
					            	<div class="clearfix g-background">
							              <div class="aui-list-item-title g-goods">关联商品：<span th:text="${orderDeal.order.fullName}"></span></div>
							              <div class="aui-text g-jd">结单时间：<span th:text="${orderDeal.dealTime}"></span></div>
						            </div>    
					            </div>
					        </li>
					    </ul>
					    </a>
					</div>
			</section>
        </div>
        <!--已退单-->
        <div class="aui-hide ishide" id="tab1-con4">
           <section class="aui-grid aui-margin-b-15">
				<div class="aui-content aui-margin-b-15 dsh" th:each="orderDeal : ${orderDealList}" th:if="${orderDeal.order.orderStatus}==6">
				    <a th:href="@{/wap/order/cancelOrder(orderId=${orderDeal.orderId})}">
				    <ul class="aui-list aui-list-in">			       
				        <li class="aui-list-item">
				            <div class="aui-list-item-inner">
				            		<div class="aui-list-item-title">订单号：<span th:text="${orderDeal.order.orderNum}"></span></div>	
				                	<div class="aui-text pos-rel state">订单类型：<span th:text="${orderDeal.order.typeName}"></span></div>	                
				            </div>
				        </li>
				        <li class="aui-list-item">
				            <div class="aui-list-item-inner">
					                <div class="aui-list-item-title s-name">
						                <p>
						                	<img src="../static/azxcrm/image/wap/head-img.jpg" th:src="@{/azxcrm/image/wap/head-img.jpg}" class="aui-img-round"/>
						                	<span th:text="${orderDeal.customerInfo.name}"></span>
					                	<span th:text="${orderDeal.customerInfo.cellphone}"></span>
						                </p>
					                </div>
					                <div class="aui-label aui-label-danger aui-label-outlined">查看详情</div>
				            </div>
				        </li>	
				        <li class="aui-list-item">
				            <div class="aui-list-item-inner">
				            	<div class="clearfix g-background">
					                <div class="aui-list-item-title g-goods">关联商品：<span th:text="${orderDeal.order.fullName}"></span></div>
					                <div class="aui-text g-jd">退款时间：<span th:text="${orderDeal.dealTime}"></span></div>
					            </div>    
				            </div>
				        </li>
				    </ul>
				    </a>
				</div>
			</section>
        </div>
    </div>     
	</body>
</html>
<script type="text/javascript">    
   		var session = sessionStorage.getItem("order");     		
   		
   		
        apiready = function(){api.parseTapmode();}
        
        var tab = new auiTab({
            element: document.getElementById("tab"),

        }, function(ret) {
        
            if (ret) {
                //定义获取对象的所有兄弟节点的函数，
                function siblings(elm) {                
                    var a = [];
                    var p = elm.parentNode.children;
                    for (var i = 0, pl = p.length; i < pl; i++) {
                        if (p[i] !== elm) a.push(p[i]);
                    }
                    return a;
                }  
                var index = ret.index;
                var activeC = document.getElementById("tab1-con" + index); 
                activeC.className = "";
                for (var i = 0; i < siblings(activeC).length; i++) {                	               		                	              	
                		 siblings(activeC)[i].className = "aui-hide";
                	
                }
            }
        });
        if(session!==null){  
   			$('.aui-tab-item').removeClass('aui-active')
   			$('.aui-tab-item').eq(session).addClass('aui-active')
   			$('.ishide').addClass('aui-hide')
   			$('.ishide').eq(session).removeClass('aui-hide')	   			
   		}  
</script>